﻿namespace LightCAD.Core.Elements
{
    public class LcEllipse : LcElement
    {
        public Vector2d Center;
        public Vector2d AxisX;
        public double RadiusX;
        public double RadiusY;
        public double StartAngle;
        public double EndAngle;
        public LcEllipse()
        {
            this.AxisX = Utils.AxisX;
            this.StartAngle = 0;
            this.EndAngle = Utils.TwoPI;
            this.Type=BuiltinElementType.Ellipse;
        }
        public LcEllipse(Vector2d center, Vector2d axisX, double radiusX, double radiusY, double startAngle = 0, double endAngle = Utils.TwoPI):this()
        {
            this.Center = center;
            this.AxisX = axisX;
            this.RadiusX = radiusX;
            this.RadiusY = radiusY;
            this.StartAngle = startAngle;
            this.EndAngle = endAngle;
        }


        public override LcElement Clone()
        {
            var clone = new LcEllipse();
            clone.Copy(this);
            return clone;
        }

        public override void Copy(LcElement src)
        {
            var ellipse = ((LcEllipse)src);
            this.Center = ellipse.Center;
            this.AxisX = ellipse.AxisX;
            this.RadiusX = ellipse.RadiusX;
            this.RadiusY = ellipse.RadiusY; ;
            this.StartAngle = ellipse.StartAngle; ;
            this.EndAngle = ellipse.EndAngle; ;
        }

        public void Set(Vector2d? center = null, Vector2d? axisX = null, double? radiusX = null, double? radiusY = null, double? startAngle = null, double? endAngle = null, bool fireChangeEvent = false)
        {

        }
    }
}
